﻿using System.Collections.Generic;
using System.Text;
using System.Linq;

namespace TripleClasses
{
    public static class TripleExtensions
    {
        public static string AsString(this IEnumerable<Triple> tripleCollection)
        {
            if (tripleCollection.Count() == 0)
                return null;
            StringBuilder strBuilder = new StringBuilder();
            foreach (Triple triple in tripleCollection)
            {
                strBuilder.Append(triple + ", ");
            }
            strBuilder.Remove(strBuilder.Length - 2, 2);
            string result = strBuilder.ToString();
            return result;
        }
    }
}